// Encode-Decode McAfee Algorythms
// "Cipher table"
unsigned char enc_table[256];

void MakeTable(unsigned short salt)
{
	unsigned long ss=salt;
	
	for (unsigned i=0;i<sizeof(enc_table);i++)
	{
		ss++;
		ss=((((ss<<6)+ss)&0xFFFFUL)%257)-1;
		enc_table[i]=(unsigned char)ss;
	}
}

void DoDecode(unsigned char * buf, unsigned start, unsigned sz)
{
	for (unsigned pos=start;pos<sz;pos++)
		buf[pos]^=enc_table[pos&0xFF];
}
